#include<iostream>
using namespace std;
int step = 0;

void doo(int n){
	if(n == 1){
		return;
	}
	step++;
	if(n%2 != 0)	doo(3*n+1);
	else	doo(n/2);		
} 

int main(){
	int n;
	cin>>n;
	
	for(int i=0;i<n;i++){
		int tmp;
		cin>>tmp;
		if(tmp == 1){
			cout<<0<<endl;
			continue;
		} 
		doo(tmp);
		cout<<step<<endl;
		step = 0;
	}
	return 0;
}
